package com.markus.code.exam.sanliu0;

import java.util.Scanner;

/**
 * Author:markusZhang
 * Date:Create in 2020/9/11 20:36
 * todo:
 */
public class Main1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNext()){
            String password = scanner.nextLine();
            boolean fuZa = isFuZa(password);
            if (fuZa){
                System.out.println("Ok");
            }else{
                System.out.println("Irregular password");
            }
        }
    }
    private static boolean isFuZa(String password){
        if (password.length() < 8){
            return false;
        }else if (!zifu(password)){
            return false;
        }
        return true;
    }
    private static boolean zifu(String str){
        char[] chars = str.toCharArray();
        boolean bigFlag = false;
        boolean smallFlag = false;
        boolean other = false;
        boolean numFlag = false;
        for (int i=0;i<chars.length;i++){
            if (chars[i] >= 'A' && chars[i] <= 'Z'){
                bigFlag = true;
            }else if (chars[i] >= 'a' && chars[i] <= 'z'){
                smallFlag = true;
            }else if (chars[i] < '0' || chars[i] > '9'){
                other = true;
            }else if (chars[i] >= '0' && chars[i] <= '9'){
                numFlag = true;
            }
        }
        return bigFlag && smallFlag && other && numFlag;
    }
}
